﻿/*
 * Copyright (c) 2025 ETH Zürich, IT Services
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

using System.Collections.Generic;
using SafeExamBrowser.Core.Contracts.Notifications;
using SafeExamBrowser.Proctoring.Contracts.Events;
using SafeExamBrowser.Settings.Proctoring;

namespace SafeExamBrowser.Proctoring.Contracts
{
	/// <summary>
	/// Defines the remote proctoring functionality.
	/// </summary>
	public interface IProctoringController
	{
		/// <summary>
		/// The notifications for all active proctoring providers.
		/// </summary>
		IEnumerable<INotification> Notifications { get; }

		/// <summary>
		/// Event fired when the status of the remaining work has been updated.
		/// </summary>
		event RemainingWorkUpdatedEventHandler RemainingWorkUpdated;

		/// <summary>
		/// Executes any remaining work like e.g. the transmission of cached screen shots. Make sure to do so before calling <see cref="Terminate"/>.
		/// </summary>
		void ExecuteRemainingWork();

		/// <summary>
		/// Indicates whether there is any remaining work which needs to be done before the proctoring can be terminated.
		/// </summary>
		bool HasRemainingWork();

		/// <summary>
		/// Initializes the given settings and starts the proctoring if the settings are valid.
		/// </summary>
		void Initialize(ProctoringSettings settings);

		/// <summary>
		/// Stops the proctoring functionality. Make sure to call <see cref="ExecuteRemainingWork"/> beforehand if necessary.
		/// </summary>
		void Terminate();
	}
}
